package com.helen.adapter;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentTransaction;
import com.helen.entity.RecoveryClassEntity;

import java.util.List;

public class FragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> mFragments;
    private List<RecoveryClassEntity> mTitles;
    private FragmentManager fm;
    private Context mContext;


    public FragmentAdapter(Context mContext, FragmentManager fm, List<Fragment> fragments,List<RecoveryClassEntity> listTitle) {
        super(fm);
        this.fm = fm;
        this.mContext = mContext;
        mFragments = fragments;
        this.mTitles = listTitle;

    }


    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public long getItemId(int position) {
        return mFragments.get(position).getArguments().getInt("tag", 0);
    }

    @Override
    public int getItemPosition(Object object) {

        return POSITION_NONE;
    }






    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles.get(position).getName();
    }
}
